﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace blackhouse.Translator.Business.Configuration {

    [ConfigurationCollection(typeof(TranslatorConfigurationManagerElement), AddItemName = "Manager", CollectionType = ConfigurationElementCollectionType.BasicMap)]
    internal class TranslatorConfigurationManagersCollection : ConfigurationElementCollection {

        #region Properties

        protected override string ElementName {
            get {
                return "Manager";
            }
        }

        #endregion

        #region Methods

        protected override bool IsElementName(string elementName) {
            return (elementName == "Manager");
        }

        protected override object GetElementKey(ConfigurationElement element) {
            return ((TranslatorConfigurationManagerElement)element).Name;
        }

        protected override ConfigurationElement CreateNewElement() {
            return new TranslatorConfigurationManagerElement();
        }

        new public TranslatorConfigurationManagerElement this[string name] {
            get { return (TranslatorConfigurationManagerElement)base.BaseGet(name); }
        }

        public override bool IsReadOnly() {
            return false;
        }

        #endregion

    }
}
